package com.luoxiang.socialandroid.view;

import android.content.Context;
import android.util.AttributeSet;
import android.webkit.WebView;

import androidx.annotation.NonNull;

public class ScrollChangeLisWebView extends WebView {
    public ScrollChangeLisWebView(Context context, AttributeSet set) {
        super(context,set);
    }

    //实时滑动监控
    //参数l代表滑动后当前位置，old代表原来原值
    @Override
    protected void onScrollChanged(int l, int t, int oldl, int oldt) {
        super.onScrollChanged(l, t, oldl, oldt);
        mScrollInterface.onSChanged(l, t, oldl, oldt);
    }

    public ScrollInterface mScrollInterface;

    //监控滑动
    public void setOnCustomScrollChangeListener(ScrollInterface scrollInterface) {
        this.mScrollInterface = scrollInterface;
    }
    public interface ScrollInterface {
        public void onSChanged(int l, int t, int oldl, int oldt);
    }

}
